const Database=require('better-sqlite3')
const tasks=require('./tasks')
const path = require('path');
const db = new Database(path.join(__dirname, 'app.db'));



function removeById(){
  try{
    db.prepare('delete from users where id=?').run(5)
    return {status:0,msg:'ok'}
  }catch(e){
    return {status:12,msg:e.message}
  }
  
}

function getAll(){
  const rows=db.prepare('select * from users').all();
  return rows;
}
removeById()
console.log(getAll())